<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>黑白名单列表</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Indexadmin/blackwhite_list',array('type'=>$type))}">
        类型：
        <select name="user_type">
            <option value="0"
            <if condition="$user_type EQ 0">selected</if>
            >黑名单</option>
            <option value="1"
            <if condition="$user_type EQ 1">selected</if>
            >白名单</option>
        </select>
        手机号码：
        <input type="text" name="mobile" style="width: 200px;" value="{:I('request.mobile')}" placeholder="请输入手机号码">
        姓名：
        <input type="text" name="name" style="width: 200px;" value="{:I('request.name')}" placeholder="姓名">
        <!--申请时间：<input class="js-date" type="text" name="starts" style="width: 200px;" value="{:I('request.starts')}" placeholder="起始时间">-->
        <!--<input class="js-date" type="text" name="ends" style="width: 200px;" value="{:I('request.ends')}" placeholder="结束时间">-->

        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="">清空</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>用户</th>
                <th>手机</th>
                <th>添加原因</th>
                <th>类型</th>
                <th>到期时间</th>
                <th>添加时间</th>
                <th>添加人</th>
                <th align="center">{:L('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.name}</td>
                    <td>{$vo.mobile}</td>
                    <td>{$vo.add_reason}</td>
                    <td>{$vo['bw_type']==0?'限时':'永久'}</td>
                    <td>
                        <if condition="$vo['bw_type'] EQ 0">
                            {$vo.bw_end_time|date='Y-m-d H:i:s',###}
                        </if>
                    </td>
                    <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                    <td>{$lastuser[$vo['createby']]|default='系统'}</td>
                    <td align="center">
                        <a href="javaScript:jcBlackWhite('{$vo[\'id\']}');" >解除</a>
                        <!--<a href="{:U('Indexadmin/jcBlackWhite',array('id'=>$vo['id']))}" >解除</a>-->
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    //删除黑白名单
    function jcBlackWhite(id){
        if(confirm("是否解除该用户限制?")){
            $.post("{:U('Indexadmin/jcBlackWhite')}",{'id':id},function(data){
                alert(data.msg);
                if('0'==data.errorCode){
                    window.location.reload();
                }
            });
        }
    }
</script>
</body>
</html>